import {Fragment} from "vue/jsx-runtime";
import http from "./http";

export const captcha = (data: any) => http.request({
    url: "/sys/user/captcha",
    params: data,
    responseType: "blob",
    method: "get"
})

export const login = (FromData: any) => http.post("/sys/user/login", FromData)

export const register = (FromData: any) => http.post("/sys/user/register", FromData)

export const getUserInfo = () => {
    return http.get("/sys/user/info")
}

//直播间

export const getLiveRoom = (params: any) => http.get("/back/liveRoom/getLiveRoomByPage", {
    params: params
})
export const getLiveRoomByLiveRoomId = (params: any) => http.get("/back/liveRoom/getLiveRoomByRoomNumber", {params: params})

export const addLiveRoom = (FormData: any) => http.post("/back/liveRoom/saveLiveRoom", FormData)

export const banLiveRoom = (params: any) => http.delete("/back/liveRoom/banLiveRoom", {
    params: params
})

export const liftBanLiveRoom = (params: any) => http.delete("/back/liveRoom/liftBanLiveRoom", {
    params: params
})

export const deleteLiveRoom = (params: any) => http.delete("/back/liveRoom/deleteLiveRoom", {
    params: params
})

export const updateLiveRoom = (FromData: any) => http.post("/back/liveRoom/updateLiveRoom", FromData)

export const uploadImg = (params: File) => http.post("/oss/oss/update", {params: params})


//角色
export const roleList = (params: any) => http.get("/sys/role/listByPage", {params: params})

export const deleteRoles = (params: any) => http.delete("/sys/role/deleteById", {params: params})

export const updateRoles = (FromData: any) => http.put("/sys/role/updateById", FromData)

export const addRoles = (FormData: any) => http.post("/sys/role/save", FormData)


//用户
export const userList = (params: any) => http.get("/sys/user/listByPage", {params: params})

export const getUserByUn = (params: any) => http.get("/sys/user/getByUsername", {params: params})

export const updateUser = (FormData: any) => http.put("/sys/user/update", FormData)

export const deleteUser = (params: any) => http.delete(`/sys/user/${params.id}`)

//主播申请
export const pageApply = (params: any) => http.get("/back/apply/pageApply", {params: params})

export const getIdentity = (id: String) => http.get("/back/identityAuthentication/getById", {params: {id}})

export const handleApply = (FormData: any) => http.put("/back/apply/handleApply", FormData)

//举报
